<template>
	<view>
		<view class="navi-bar">
			<view class="navi-back" @click="goBack">
				<
			</view>
			<view class="navi-title">
				问答
			</view>
		</view>
		<u-gap height="100" bgColor="#fff"></u-gap>
		<view class="red-list">
			<view class="red-item" @click="naviTo(r.question_id)" v-for="(r, i) in UserCollectQuestionList">
				<view class="red-left">
					<view class="left-title">
						{{r.question_title}}
					</view>
					<view class="left-name">
						{{r.answer_content}}
					</view>
				</view>
				<view class="red-right">
					>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		http
	} from '../../untils/http.js'
	
	const url = 'othercollection/8878093/more/2/0'
	
	export default {
		data() {
			return {
				UserCollectQuestionList: []
			}
		},
		created() {
			http(url).then(res => {
				this.UserCollectQuestionList = res.data
				console.log(this.UserCollectQuestionList);
			})
		},
		methods: {
			naviTo(id) {
				uni.navigateTo({
					url: '../QuestionContent/QuestionContent?id=' + id
				})
			},
			goBack() {
				// 返回上一级并刷新当前页面
				this.$router.go(-1)
			}
		}
	}
</script>

<style lang="scss">
	* {
		box-sizing: border-box;
	}
	
	.navi-bar {
		position: fixed;
		width: 750rpx;
		height: 100rpx;
		line-height: 100rpx;
		z-index: 1000;
		background-color: #fff;
		font-weight: 600;
		
		.navi-back {
			margin-left: 15px;
			float: left;
		}
		
		.navi-title {
			margin-right: 28px;
			text-align: center;
		}
	}
	
	.red-list {
		width: 750rpx;
	}
	
	.red-item {
		padding: 10px;
		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 100%;
		border-bottom: 1px solid #dddddd;
		
		.red-left {
			display: flex;
			flex-direction: column;
			
			.left-title {
				margin-top: 5px;
				width: 650rpx;
				font-size: 12px;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
			}
			
			.left-name {
				width: 650rpx;
				font-size: 10px;
				color: #939393;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
			}
		}
	}
</style>
